import { Rule, RuleType } from "@midwayjs/validate";
import { PageDTO } from "@dto/common/page.dto";

// 查询参数
export class ListNoticeDTO extends PageDTO {
  @Rule(RuleType.string())
  noticeTitle?: string;

  @Rule(RuleType.string())
  createBy?: string;

  @Rule(RuleType.string())
  noticeType?: string;
}

// 新增参数
export class CreateNoticeDTO {
  @Rule(RuleType.string().required())
  noticeTitle: string;

  @Rule(RuleType.string().required())
  noticeType: string;

  @Rule(RuleType.string())
  status?: string;

  @Rule(RuleType.string().max(2000))
  noticeContent: string;
}

// 修改参数
export class UpdateNoticeDTO extends CreateNoticeDTO{
  @Rule(RuleType.number().required())
  noticeId: number;
}
